<?php

/**
 * Created by PhpStorm.
 * User: yanshinian@yeah.net
 * Date: 2019/5/22
 * Time: 17:51.
 * jd.union.open.promotion.byunionid.get
 * 工具商获取推广链接接口
 */
class UnionOpenPromotionByunionidGetRequest
{
    /**
     * @var String  推广物料链接，建议链接使用微Q前缀，能较好适配微信手Q页面  https://wqitem.jd.com/item/view?sku=23484023378
     */
    private $materialId;
    /**
     * @var long  站点ID是指在联盟后台的推广管理中的网站Id、APPID（1、通用转链接口禁止使用社交媒体id入参；2、订单来源，即投放链接的网址或应用必须与传入的网站ID/AppID备案一致，否则订单会判“无效-来源与备案网址不符”）
     */
    private $unionId ;
    /**
     * @var int  新增推广位id （不填的话，为其默认生成一个唯一此接口推广位-名称：微信手Q短链接）
     */
    private $positionId ;
    /**
     * @var String  子联盟ID（需申请，申请方法请见https://union.jd.com/helpcenter/13246-13247-46301），该字段为自定义参数，建议传入字母数字和下划线的格式
     */
    private $subUnionId;
    /**
     * @var String   子帐号身份标识，格式为子站长ID_子站长网站ID_子站长推广位ID
     */
    private $pid;
    /**
     * @var String 优惠券领取链接，在使用优惠券、商品二合一功能时入参，且materialId须为商品详情页链接
     */
    private $couponUrl;
    /**
     * @var String  转链类型，1：长链， 2 ：短链 ，3： 长链+短链，默认短链
     */
    private $chainType;


    private $apiParas = array();

    public function setMaterialId($materialId)
    {
        $this->materialId = $materialId;
        $this->apiParas['materialId'] = $materialId;
    }

    public function getMaterialId()
    {
        return $this->materialId;
    }

    public function setUnionId($unionId)
    {
        $this->unionId = $unionId;
        $this->apiParas['unionId'] = $unionId;
    }

    public function getUnionId()
    {
        return $this->unionId;
    }

    public function setPositionId($positionId)
    {
        $this->positionId = $positionId;
        $this->apiParas['positionId'] = $positionId;
    }

    public function getPositionId()
    {
        return $this->positionId;
    }

    public function setSubUnionId($subUnionId)
    {
        $this->subUnionId = $subUnionId;
        $this->apiParas['subUnionId'] = $subUnionId;
    }

    public function getSubUnionId()
    {
        return $this->subUnionId;
    }

    public function setPid($pid)
    {
        $this->pid = $pid;
        $this->apiParas['pid'] = $pid;
    }

    public function getPid()
    {
        return $this->pid;
    }

    public function setCouponUrl($couponUrl)
    {
        $this->couponUrl = $couponUrl;
        $this->apiParas['couponUrl'] = $couponUrl;
    }

    public function getCouponUrl()
    {
        return $this->couponUrl;
    }

    public function setChainType($chainType)
    {
        $this->chainType = $chainType;
        $this->apiParas['chainType'] = $chainType;
    }

    public function getChainType()
    {
        return $this->chainType;
    }


    public function getApiMethodName()
    {
        return 'jd.union.open.promotion.common.get';
    }

    public function getApiParas()
    {
        return array('promotionCodeReq' => $this->apiParas);
    }

    public function check()
    {
        RequestCheckUtil::checkNotNull($this->materialId,"materialId");
        RequestCheckUtil::checkNotNull($this->siteId,"siteId");
    }

    public function putOtherTextParam($key, $value)
    {
        $this->apiParas[$key] = $value;
        $this->$key = $value;
    }
}
